package com.sxt.jt808.dto;

import org.springframework.stereotype.Component;

import io.netty.buffer.ByteBuf;

/**
 * @Author: 罗林
 * @Date: 2019-12-15
 * @Description:基础消息结构
 * @Version: 1.0
 */
@Component
public abstract class BaseMsg {
	
	/**
	 * 消息体ByteBuf(方便后期采用ByteBuf计算)
	 */
	private ByteBuf msgByteBuf;
	
	public abstract void parseBody();
	/**
	 * 无参构造函数
	 * 
	 * @param raw
	 * @return
	 */
	public BaseMsg() {

	}

	/**
	 * 有参构造函数
	 * 
	 * @param byteBuf
	 * @return
	 */
	public BaseMsg(ByteBuf byteBuf) {
		this.setMsgByteBuf(byteBuf);
		//this.setMsgByteBuf(byteBuf);
	}
	
	//TODO get set
	public ByteBuf getMsgByteBuf() {
		return msgByteBuf;
	}
	public void setMsgByteBuf(ByteBuf msgByteBuf) {
		this.msgByteBuf = msgByteBuf;
	}
	
}
